package com.itheima.web.controller.system;

import com.itheima.service.CompanyService;
import com.itheima.service.impl.CompanyServiceImpl;
import com.itheima.service.impl.DeptServiceImpl;
import com.itheima.service.impl.UserServiceImpl;
import com.itheima.service.system.DeptService;
import com.itheima.service.system.UserService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
//为什么另外创建BaseServlet类继承HttpServleet?
        //抽取类似   CompanyService companyService=new CompanyServiceImpl();的东西,方便使用
public class BaseServlet extends HttpServlet {
    protected CompanyService companyService;
    protected DeptService deptService;
    protected UserService userService;
    @Override
    //init()?是干嘛的?
            //init|初始化|,init方法是在Servlet实例化之后执行的，并且只执行一次。

    public void init() throws ServletException {
        companyService = new CompanyServiceImpl();
        deptService = new DeptServiceImpl();
        userService = new UserServiceImpl();
    }
}
